@extends('home.layout.user')
@section('user')
	<div class="m_right">
        	
            
            <div class="mem_t">基本信息</div>
            <table border="0" class="mon_tab" style="width:870px; margin-bottom:20px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="33%">用户身份：<span style="color:#555555;">@if($user['authority'] == 0)塘主 @else普通用户 @endif</span></td>
                <td width="33%"><span></span></td>
                <td width="33%"><span></span></td>
              </tr>
              <tr>
               <td width="33%">我的发布：<span>{{$goods}}个闲置</span></td>
                
                <td><span style="color:#555555;"></span></td></td>
                <td><span></span></td></td>
              </tr>
              <tr>
               <td width="33%">我的购买：<span>{{$order}}个闲置</span></td>
                <td><span style="color:#555555;"></span></td></td>
                <td><span></span></td></td>
              </tr>
               <tr>
               <td>当前积分：<span id='jifen' style='flaot:left'>{{ $userinfo['code']}}</span>&nbsp; &nbsp;<span><button id="qiandao" value="{{ $userinfo['codetime'] }}" style="display:none" >签到</button></span></td></td>
                <td><span style="color:#555555;"></span></td></td>
                <td><span></span></td></td>
              </tr>

              <tr>
                <td colspan="3">订单提醒：
                	<font style="font-family:'宋体';"> 待收货(<span>2</span>) &nbsp; &nbsp; &nbsp; &nbsp; </font>
                </td>
              </tr>
            </table>

            <div class="mem_t">账号信息 &nbsp; <a href="/user/{{$userinfo['id']}}/edit"><span style='font-size:1px;color:#0af'>修改</span></a> </div>
            <table border="0" class="mon_tab" style="width:870px; margin-bottom:20px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="40%">电&nbsp; &nbsp; 话：<span style="color:#555555;">{{$user['phone']}}</span></td>
                <td width="60%">邮&nbsp; &nbsp; 箱：<span style="color:#555555;">{{$user['email']}}</span></td>
              </tr>
              <tr>
                <td>性&nbsp; &nbsp; 别：<span style="color:#555555;">@if($userinfo['sex'] == 1)男 @else女 @endif</span></td>
                <td>生&nbsp; &nbsp; 日：<span style="color:#555555;">{{$userinfo['birthday']}}</span></td>
              </tr>
              <tr>
                <td>收货地址：<span style="color:#555555;">{{$userinfo['address']}}</span></td>
                <td>注册时间：<span style="color:#555555;">{{$user['ctime']}}</span></td>
              </tr>
            </table>
               
            
        </div>
        <script>
          $('#qiandao').click(function(){
            $.get('/qiandao?code='+($('#jifen').text())+'&id='+{{$userinfo['id']}},function(msg){
              // console.log(parseInt(msg+'000'))
              // console.log(Date.parse(new Date()))
             if(Date.parse(new Date())>(parseInt(msg+'000'))+60*60*24){
                  $('#qiandao').css('display','block')
                }else{
                   $('#qiandao').css('display','none')
                }
            })
            $('#jifen').html(parseInt($('#jifen').text())+5)
          })
          
            $.get('/jifen?code='+($('#jifen').text())+'&id='+{{$userinfo['id']}},function(msg){
              // console.log(parseInt(msg+'000'))
              // console.log(Date.parse(new Date()))
              if(Date.parse(new Date())>(parseInt(msg+'000'))+60*60*24){
                  $('#qiandao').css('display','block')
                }else{
                   $('#qiandao').css('display','none')
                }
            })
          
        </script>
         
@endsection
